#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
struct stu {
	long long num;
	float score;
};
int cmp_int(const void* p1, const void* p2) {
	if ((((struct stu*)p2)->score - ((struct stu*)p1)->score) > 0) {
		return 1;
	}
	else if ((((struct stu*)p2)->score - ((struct stu*)p1)->score) == 0) {
		return 0;
	}
	else {
		return -1;
	}
}
int main()
{
	int n, k;
	scanf("%d%d", &n, &k);
	struct stu students[50];
	int i=0; 
	for ( i = 0; i < n; i++) {
		scanf("%lld%f", &students[i].num, &students[i].score);
	}
	qsort(students, n, sizeof(students[0]), cmp_int);
//	for (int i = 0; i < n; i++) {
//		printf("%ld %f\n", students[i].num, students[i].score);
//	}
	printf("%lld %f", students[k - 1].num, students[k - 1].score);
	return 0;
}
